using System;
using System.IO;
using System.Net.NetworkInformation;

// 定义目标接口
public interface ITarget
{
    void Request();
}

// 定义被适配者类
public class Adaptee
{
    public void SpecializedRequest()
    {
        Console.WriteLine("Adaptee's specialized request.");
    }
}

// 定义适配器类，实现目标接口并包含对被适配者的引用
public class Adapter : ITarget
{
    private Adaptee _adaptee;

    public Adapter(Adaptee adaptee)
    {
        _adaptee = adaptee;
    }

    public void Request()
    {
        // 调用被适配者的方法，以适配目标接口
        _adaptee.SpecializedRequest();
    }
}

// 客户端代码
public class Client
{
    public void Execute(ITarget target)
    {
        target.Request();
    }

    public static void Main()
    {
        Adaptee adaptee = new Adaptee();
        ITarget adapter = new Adapter(adaptee);
        Client client = new Client();
        client.Execute(adapter);
    }
}

//输出结果：Adaptee's specialized request.